package com.flyxteam.commons.dao.mybatis.core.sqlbuilder;

import java.util.List;

import com.flyxteam.commons.dao.mybatis.api.condition.Condition;

/**
 * SELECT SQL构建器
 * @author yuzh
 *
 */
public class SelectSqlBuilder extends ConditionSqlBuilder {
	
	public SelectSqlBuilder(String tableName, List<Condition> conditionColumns) {
		this.tableName = tableName;
		this.conditionColumns = conditionColumns;
	}

	@Override
	public String buildSqlString() {
		// select * from tableName where ... 
		StringBuilder selectSql = new StringBuilder("select * from ");
		selectSql.append(tableName).append(" ");
		String conditionSql = buildConditionSqlString();
		selectSql.append(conditionSql);
		
		return selectSql.toString();
	}

}
